package hello;

public class DataTypeDemo {
    public static void main(String[] args) {

        /**
         * 基本数据类型
         * DataType: <declare type> (<Class name>): <range>
         * 
         * - short (Short): 2 byte 1000 0000 0000 0000 ~ 0111 1111 1111 1111 (-32768 ~ 32767)
         * - long (Long): 8 byte
         * - int (Integer): 4 byte
         * - byte (Byte): 1000 0000 ~ 0111 1111 (-128 ~ 127)
         * - float (Float): 4 byte
         * - double (Double): 8 byte
         * - char (Character):
         * - boolean (Boolean): true / false
         * 
         * |                                             ^
         * | { Wrapper Types (包裹类型) / Autoboxing }    | { Unboxing }
         * v                                             |
         * 
         * 
         * 对象
         * ...
         * 
         */
        

        short shortA = 1;
        int intA = 111;
        long longA = 11111l;

        byte byteF = 010;

        float floatB = 2.22f;
        double doubleC = 3.3333;
        
        char charD = 'D';

        boolean boolE = true;

        // type conversion
        int intF = (int) doubleC;

        /**
         * Comparision Operator
         *   >
         *   <
         *   >=
         *   <=
         *   ==
         *   !=
         * 
         * Conditional Operator
         *   ( ? : )
         * 
         * Logical Operator
         *   &&
         *   ||
         *   !
         * 
         * Bitwise Operator
         *   &
         *   |
         *   ^
         *   ~ (补数)
         *   << (右补 0)
         *   >> (左补原位元)
         *   >>> (左补 0)
         * 
         * Increment Operator
         *   ++
         * 
         * Decrement Operator
         *   --
         * 
         * Assignment Operator
         *   +=
         *   -=
         *   *=
         *   /=
         *   %=
         *   &=
         *   |=
         *   ^=
         *   <<=
         *   >>=
         *
         */
        char charBefore = 'A';
        char charAfter = (char) (charBefore ^ 0x7); // 'F'
        charAfter = (char) (charAfter ^ 0x7); // 'A'
    }
}